<template>
    <div class="app-container">
      <el-form :model="queryParams"  ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
        <!-- <el-form-item label="物料名称" prop="chinaName">
          <el-input
            v-model="queryParams.chinaName"
            placeholder="请输入物料名称"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item> -->
        <!-- <el-form-item label="别名" prop="asName">
          <el-input
            v-model="queryParams.asName"
            placeholder="请输入别名"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="bom名称" prop="bomName">
          <el-input
            v-model="queryParams.bomName"
            placeholder="请输入bom名称"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="bom版本" prop="bomVar">
          <el-input
            v-model="queryParams.bomVar"
            placeholder="请输入bom版本"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="父项编码" prop="parentId">
          <el-input
            v-model="queryParams.parentId"
            placeholder="请输入父项编码"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="父项目版本" prop="fatherPartvar">
          <el-input
            v-model="queryParams.fatherPartvar"
            placeholder="请输入父项目版本"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item> -->
        <el-form-item label="物料编码" prop="partId">
          <el-input
            v-model="queryParams.partId"
            placeholder="请输入物料编码"
            clearable
            @keyup.enter.native="handleQuery"
            required
          />
        </el-form-item>
        <!-- <el-form-item label="期间" prop="moth">
          <el-input
            v-model="queryParams.moth"
            placeholder="请输入期间"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="层次号" prop="assembLelevel">
          <el-input
            v-model="queryParams.assembLelevel"
            placeholder="请输入层次号"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="物料版本" prop="partVar">
          <el-input
            v-model="queryParams.partVar"
            placeholder="请输入物料版本"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="数量" prop="counts">
          <el-input
            v-model="queryParams.counts"
            placeholder="请输入数量"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="年度" prop="year">
          <el-input
            v-model="queryParams.year"
            placeholder="请输入年度"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="市场价格" prop="marketPrice">
          <el-input
            v-model="queryParams.marketPrice"
            placeholder="请输入市场价格"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="材料价格" prop="price">
          <el-input
            v-model="queryParams.price"
            placeholder="请输入材料价格"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="含税单价" prop="taxPrice">
          <el-input
            v-model="queryParams.taxPrice"
            placeholder="请输入含税单价"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="市场价格(含税)" prop="marktaxPrice">
          <el-input
            v-model="queryParams.marktaxPrice"
            placeholder="请输入市场价格(含税)"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="成品价格" prop="productPrice">
          <el-input
            v-model="queryParams.productPrice"
            placeholder="请输入成品价格"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="直接人工" prop="workFee">
          <el-input
            v-model="queryParams.workFee"
            placeholder="请输入直接人工"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="天然气" prop="gasFee">
          <el-input
            v-model="queryParams.gasFee"
            placeholder="请输入天然气"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="电费" prop="elecFee">
          <el-input
            v-model="queryParams.elecFee"
            placeholder="请输入电费"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="制造费用" prop="makeFee">
          <el-input
            v-model="queryParams.makeFee"
            placeholder="请输入制造费用"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="标准合计" prop="stTotalFee">
          <el-input
            v-model="queryParams.stTotalFee"
            placeholder="请输入标准合计"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="合计" prop="totalFee">
          <el-input
            v-model="queryParams.totalFee"
            placeholder="请输入合计"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="毛利率" prop="grossProfitRate">
          <el-input
            v-model="queryParams.grossProfitRate"
            placeholder="请输入毛利率"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="标准销售价格" prop="stSalePrice">
          <el-input
            v-model="queryParams.stSalePrice"
            placeholder="请输入标准销售价格"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="销售价格" prop="salePrice">
          <el-input
            v-model="queryParams.salePrice"
            placeholder="请输入销售价格"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="时间戳" prop="nodeTimesTamp">
          <el-date-picker clearable
            v-model="queryParams.nodeTimesTamp"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="选择时间戳">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="价格时间" prop="priceTime">
          <el-date-picker clearable
            v-model="queryParams.priceTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="选择价格时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="备注" prop="marks">
          <el-input
            v-model="queryParams.marks"
            placeholder="请输入备注"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="基期" prop="partDate">
          <el-date-picker clearable
            v-model="queryParams.partDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="选择基期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="root值" prop="rootCode">
          <el-input
            v-model="queryParams.rootCode"
            placeholder="请输入root值"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="序列号" prop="seqnum">
          <el-input
            v-model="queryParams.seqnum"
            placeholder="请输入序列号"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item> -->
        <el-form-item>
          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
          <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
        </el-form-item>
      </el-form>
  
      <el-row :gutter="10" class="mb8">
        <!-- <el-col :span="1.5">
          <el-button
            type="primary"
            plain
            icon="el-icon-plus"
            size="mini"
            @click="handleAdd"
            v-hasPermi="['system:bomCost:add']"
          >新增</el-button>
        </el-col> -->
        <el-col :span="1.5">
          <el-button
            type="info"
            plain
            icon="el-icon-sort"
            size="mini"
            @click="toggleExpandAll"
          >展开/折叠</el-button>
        </el-col>
        <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
      </el-row>
  
      <el-table
        v-if="refreshTable"
        v-loading="loading"
        :data="costList"
        row-key="partId"
        :default-expand-all="isExpandAll"
        :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
        style="width: 100%"
        height="calc(100vh - 85px)"
        :row-class-name="tableRowClassName"
      >

        <el-table-column label="物料名称" header-align="center" prop="chinaName" min-width="220px" fixed/>
        <el-table-column label="类型编码" prop="type" />
        <el-table-column label="别名" align="center" prop="asName" />
        <!-- <el-table-column label="bom名称" align="center" prop="bomName" /> -->
        <!-- <el-table-column label="bom版本" align="center" prop="bomVar" /> -->
        <el-table-column label="父项编码" align="center" prop="parentId" min-width="150px" />
        <!-- <el-table-column label="父项目版本" align="center" prop="fatherPartvar" /> -->
        <el-table-column label="物料编码" align="center" prop="partId" min-width="150px" />
        <!-- <el-table-column label="期间" align="center" prop="moth" /> -->
        <!-- <el-table-column label="层次号" align="center" prop="assembLelevel" /> -->
        <!-- <el-table-column label="物料版本" align="center" prop="partVar" /> -->
        <el-table-column label="数量" align="center" prop="counts" :formatter="matter" />
        <!-- <el-table-column label="年度" align="center" prop="year" /> -->
        <el-table-column label="材料价格" align="center" prop="price" min-width="100px" :formatter="matter" />
        <el-table-column label="市场价格" align="center" prop="marketPrice" min-width="100px" :formatter="matter" />
        <!-- <el-table-column label="含税单价" align="center" prop="taxPrice" /> -->
        <!-- <el-table-column label="市场价格(含税)" align="center" prop="marktaxPrice" /> -->
        <el-table-column label="成品价格" align="center" prop="productPrice" min-width="100px" :formatter="matter" />
        <el-table-column label="直接人工" align="center" prop="workFee" :formatter="matter" />
        <el-table-column label="天然气" align="center" prop="gasFee" :formatter="matter" />
        <el-table-column label="电费" align="center" prop="elecFee" :formatter="matter" />
        <el-table-column label="制造费用" align="center" prop="makeFee" :formatter="matter" />
        <el-table-column label="标准成本" align="center" prop="stTotalFee" min-width="90px" :formatter="matter" />
        <el-table-column label="市场成本" align="center" prop="totalFee" min-width="90px" :formatter="matter" />
        <!-- <el-table-column label="毛利率" align="center" prop="grossProfitRate" /> -->
        <!-- <el-table-column label="标准销售价格" align="center" prop="stSalePrice" /> -->
        <!-- <el-table-column label="销售价格" align="center" prop="salePrice" /> -->
        <!-- <el-table-column label="时间戳" align="center" prop="nodeTimesTamp" width="180">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.nodeTimesTamp, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="价格时间" align="center" prop="priceTime" width="180">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.priceTime, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="备注" align="center" prop="marks" />
        <el-table-column label="基期" align="center" prop="partDate" width="180">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.partDate, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="root值" align="center" prop="rootCode" />
        <el-table-column label="序列号" align="center" prop="seqnum" /> -->
        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
          <template slot-scope="scope">
            <el-button
              size="mini"
              type="text"
              icon="el-icon-edit"
              @click="handleUpdate(scope.row)"
              v-hasPermi="['system:bomCost:edit']"
            >修改</el-button>
            <!-- <el-button
              size="mini"
              type="text"
              icon="el-icon-plus"
              @click="handleAdd(scope.row)"
              v-hasPermi="['system:bomCost:add']"
            >新增</el-button> -->
            <!-- <el-button
              size="mini"
              type="text"
              icon="el-icon-delete"
              @click="handleDelete(scope.row)"
              v-hasPermi="['system:bomCost:remove']"
            >删除</el-button> -->
          </template>
        </el-table-column>
      </el-table>
  
      <!-- 添加或修改bom模型对话框 -->
      <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
        <el-form ref="form" :model="form" :rules="rules" label-width="80px">
          <el-form-item label="物料名称" prop="chinaName">
            <el-input v-model="form.chinaName" placeholder="请输入物料名称" :readonly="false"/>
          </el-form-item>
          <!-- <el-form-item label="bom名称" prop="bomName">
            <el-input v-model="form.bomName" placeholder="请输入bom名称" />
          </el-form-item>
          <el-form-item label="bom版本" prop="bomVar">
            <el-input v-model="form.bomVar" placeholder="请输入bom版本" />
          </el-form-item>
          <el-form-item label="父项编码" prop="parentId">
            <treeselect v-model="form.parentId" :options="costOptions" :normalizer="normalizer" placeholder="请选择父项编码" />
          </el-form-item>
          <el-form-item label="父项目版本" prop="fatherPartvar">
            <el-input v-model="form.fatherPartvar" placeholder="请输入父项目版本" />
          </el-form-item>
          <el-form-item label="物料编码" prop="partId">
            <el-input v-model="form.partId" placeholder="请输入物料编码" />
          </el-form-item>
          <el-form-item label="期间" prop="moth">
            <el-input v-model="form.moth" placeholder="请输入期间" />
          </el-form-item>
          <el-form-item label="层次号" prop="assembLelevel">
            <el-input v-model="form.assembLelevel" placeholder="请输入层次号" />
          </el-form-item>
          <el-form-item label="物料版本" prop="partVar">
            <el-input v-model="form.partVar" placeholder="请输入物料版本" />
          </el-form-item>
          <el-form-item label="数量" prop="counts">
            <el-input v-model="form.counts" placeholder="请输入数量" />
          </el-form-item>
          <el-form-item label="年度" prop="year">
            <el-input v-model="form.year" placeholder="请输入年度" />
          </el-form-item> -->
          <el-form-item label="材料价格" prop="price">
            <el-input v-model="form.price" placeholder="请输入材料价格" />
          </el-form-item>
          <el-form-item label="市场价格" prop="marketPrice" >
            <el-input v-model="form.marketPrice" placeholder="请输入市场价格" :readonly="status ? false : 'readonly'"/>
          </el-form-item>
          <!-- <el-form-item label="含税单价" prop="taxPrice">
            <el-input v-model="form.taxPrice" placeholder="请输入含税单价" />
          </el-form-item>
          <el-form-item label="市场价格(含税)" prop="marktaxPrice">
            <el-input v-model="form.marktaxPrice" placeholder="请输入市场价格(含税)" />
          </el-form-item>
          <el-form-item label="成品价格" prop="productPrice">
            <el-input v-model="form.productPrice" placeholder="请输入成品价格" />
          </el-form-item> -->
          <el-form-item label="直接人工" prop="workFee">
            <el-input v-model="form.workFee" placeholder="请输入直接人工" />
          </el-form-item>
          <el-form-item label="天然气" prop="gasFee">
            <el-input v-model="form.gasFee" placeholder="请输入天然气" />
          </el-form-item>
          <el-form-item label="电费" prop="elecFee">
            <el-input v-model="form.elecFee" placeholder="请输入电费" />
          </el-form-item>
          <el-form-item label="制造费用" prop="makeFee">
            <el-input v-model="form.makeFee" placeholder="请输入制造费用" />
          </el-form-item>
          <!-- <el-form-item label="标准合计" prop="stTotalFee">
            <el-input v-model="form.stTotalFee" placeholder="请输入标准合计" />
          </el-form-item>
          <el-form-item label="合计" prop="totalFee">
            <el-input v-model="form.totalFee" placeholder="请输入合计" />
          </el-form-item>
          <el-form-item label="毛利率" prop="grossProfitRate">
            <el-input v-model="form.grossProfitRate" placeholder="请输入毛利率" />
          </el-form-item>
          <el-form-item label="标准销售价格" prop="stSalePrice">
            <el-input v-model="form.stSalePrice" placeholder="请输入标准销售价格" />
          </el-form-item>
          <el-form-item label="销售价格" prop="salePrice">
            <el-input v-model="form.salePrice" placeholder="请输入销售价格" />
          </el-form-item>
          <el-form-item label="时间戳" prop="nodeTimesTamp">
            <el-date-picker clearable
              v-model="form.nodeTimesTamp"
              type="date"
              value-format="yyyy-MM-dd"
              placeholder="选择时间戳">
            </el-date-picker>
          </el-form-item>
          <el-form-item label="价格时间" prop="priceTime">
            <el-date-picker clearable
              v-model="form.priceTime"
              type="date"
              value-format="yyyy-MM-dd"
              placeholder="选择价格时间">
            </el-date-picker>
          </el-form-item>
          <el-form-item label="备注" prop="marks">
            <el-input v-model="form.marks" placeholder="请输入备注" />
          </el-form-item>
          <el-form-item label="基期" prop="partDate">
            <el-date-picker clearable
              v-model="form.partDate"
              type="date"
              value-format="yyyy-MM-dd"
              placeholder="选择基期">
            </el-date-picker>
          </el-form-item>
          <el-form-item label="root值" prop="rootCode">
            <el-input v-model="form.rootCode" placeholder="请输入root值" />
          </el-form-item>
          <el-form-item label="序列号" prop="seqnum">
            <el-input v-model="form.seqnum" placeholder="请输入序列号" />
          </el-form-item> -->
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button type="primary" @click="submitForm">确 定</el-button>
          <el-button @click="cancel">取 消</el-button>
        </div>
      </el-dialog>
    </div>
  </template>
  
  <style>
  .el-table .warning-row {
    background: rgb(250, 244, 232);
  }

  .el-table .success-row {
    background: #eff6ec;
  }

  .el-table .danger-row {
    background: #f8e8e8;
  }

  .el-table .info-row {
    background: #95979a;
  }

  .el-table .barand-row {
    background: #eff8fcda;
  }
</style>

  <script>
  import { listCost1, listCost3,  getCost, delCost, addCost, updateCost } from "@/api/factory/bom/bomCostSingle";
  import Treeselect from "@riophae/vue-treeselect";
  import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  
  export default {
    name: "Cost",
    components: {
      Treeselect
    },
    data() {
      return {
        // 遮罩层
        loading: true,
        // 显示搜索条件
        showSearch: true,
        // bom模型表格数据
        costList: [],
        // bom模型树选项
        costOptions: [],
        // 弹出层标题
        title: "",
        // 是否显示弹出层
        open: false,
        // 是否展开，默认全部展开
        isExpandAll: false,
        // 重新渲染表格状态
        refreshTable: true,
        // 查询参数
        queryParams: {
          type: null,
          chinaName: null,
          asName: null,
          bomName: null,
          bomVar: null,
          parentId: null,
          fatherPartvar: null,
          partId: null,
          moth: null,
          assembLelevel: null,
          partVar: null,
          counts: null,
          year: null,
          marketPrice: null,
          price: null,
          taxPrice: null,
          marktaxPrice: null,
          productPrice: null,
          workFee: null,
          gasFee: null,
          elecFee: null,
          makeFee: null,
          stTotalFee: null,
          totalFee: null,
          grossProfitRate: null,
          stSalePrice: null,
          salePrice: null,
          nodeTimesTamp: null,
          priceTime: null,
          marks: null,
          partDate: null,
          rootCode: null,
          seqnum: null
        },
        // 表单参数
        form: {},
        // 表单校验
        rules: {
          partId: [
            { required: true, message: "物料编码不能为空", trigger: "blur" }
          ],
          asName: [
            { required: true, message: "别名不能为空", trigger: "blur" }
          ],
        }
      };
    },
    created() {
      this.getList();
    },
    methods: {

         // 添加千分符保留3为小数
    matter(row, column, cellValue) {
      if(null === cellValue) return '';
      cellValue += ''
      if (!cellValue.includes('.')) cellValue += '.'
      return parseFloat(cellValue).toFixed(3).replace(/(\d)(?=(\d{3})+\.)/g, function($0, $1) {
        return $1 + ','
      }).replace(/\.$/, '')
    },

    tableRowClassName({row, rowIndex}) {
      let arr = row.seqnum.split(".")
      arr.length
      
        if (arr.length === 1) {
          return 'barand-row';
        } else if (arr.length === 2) {
          return 'success-row';
        } else if (arr.length === 3) {
          return 'warning-row';
        } else if (arr.length === 4) {
          return 'danger-row';
        } else if (arr.length === 5) {
          return 'info-row';
        }
        return '';
      },
      /** 查询bom模型列表 */
      getList() {
        this.loading = true;
        
        listCost1(this.queryParams).then(response => {
          this.costList = this.handleTree(response.data, "partId", "parentId");
          this.loading = false;
        });
      },
      /** 转换bom模型数据结构 */
      normalizer(node) {
        if (node.children && !node.children.length) {
          delete node.children;
        }
        return {
          id: node.partId,
          label: node.chinaName,
          children: node.children
        };
      },
      /** 查询bom模型下拉树结构 */
      getTreeselect() {
        listCost1().then(response => {
          this.costOptions = [];
          const data = { partId: 0, chinaName: '顶级节点', children: [] };
          data.children = this.handleTree(response.data, "partId", "parentId");
          this.costOptions.push(data);
        });
      },
      // 取消按钮
      cancel() {
        this.open = false;
        this.reset();
      },
      // 表单重置
      reset() {
        this.form = {
          id: null,
          type: null,
          chinaName: null,
          asName: null,
          bomName: null,
          bomVar: null,
          parentId: null,
          fatherPartvar: null,
          partId: null,
          moth: null,
          assembLelevel: null,
          partVar: null,
          counts: null,
          year: null,
          marketPrice: null,
          price: null,
          taxPrice: null,
          marktaxPrice: null,
          productPrice: null,
          workFee: null,
          gasFee: null,
          elecFee: null,
          makeFee: null,
          stTotalFee: null,
          totalFee: null,
          grossProfitRate: null,
          stSalePrice: null,
          salePrice: null,
          nodeTimesTamp: null,
          priceTime: null,
          marks: null,
          createTime: null,
          updateTime: null,
          partDate: null,
          rootCode: null,
          seqnum: null
        };
        this.resetForm("form");
      },
      /** 搜索按钮操作 */
      handleQuery() {
        this.getList();
      },
      /** 重置按钮操作 */
      resetQuery() {
        this.resetForm("queryForm");
        this.handleQuery();
      },
      /** 新增按钮操作 */
      handleAdd(row) {
        this.reset();
        this.getTreeselect();
        if (row != null && row.partId) {
          this.form.parentId = row.partId;
        } else {
          this.form.parentId = 0;
        }
        this.open = true;
        this.title = "添加bom模型";
      },
      /** 展开/折叠操作 */
      toggleExpandAll() {
        this.refreshTable = false;
        this.isExpandAll = !this.isExpandAll;
        this.$nextTick(() => {
          this.refreshTable = true;
        });
      },
      /** 修改按钮操作 */
      handleUpdate(row) {
        this.reset();
        this.getTreeselect();
        if (row != null) {
          this.form.parentId = row.partId;
        }
        getCost(row.id).then(response => {
          this.form = response.data;
          this.open = true;
          this.title = "修改bom模型";
        });
      },
      /** 提交按钮 */
      submitForm() {
        this.$refs["form"].validate(valid => {
          if (valid) {
            if (this.form.id != null) {
              updateCost(this.form).then(response => {
                this.$modal.msgSuccess("修改成功");
                this.open = false;
                this.getList();
              });
            } else {
              addCost(this.form).then(response => {
                this.$modal.msgSuccess("新增成功");
                this.open = false;
                this.getList();
              });
            }
          }
        });
      },
      /** 删除按钮操作 */
      handleDelete(row) {
        this.$modal.confirm('是否确认删除bom模型编号为"' + row.id + '"的数据项？').then(function() {
          return delCost(row.id);
        }).then(() => {
          this.getList();
          this.$modal.msgSuccess("删除成功");
        }).catch(() => {});
      }
    }
  };
  </script>
  